package com.birdcage.goldminer;

import com.birdcage.gamemanagers.GameObjectManager;
import com.birdcage.gamemanagers.GraphicsManager;
import com.birdcage.gamemanagers.PhysicsManager;
import com.birdcage.gamemanagers.Utility;
import com.birdcage.goldminer.gameobjects.Hook;
import com.birdcage.goldminer.gameobjects.Player;
import com.birdcage.goldminer.gameobjects.Stone;

/// Singleton
/// This class contains every thing of the whole game(data, resource, logic, ect...)
public class Game
{    
    // /Singleton Implement
    static public Game GetInstance()
    {
        if (m_instance == null)
        {
            m_instance = new Game();
        }
        return m_instance;
    }

    private Game()
    {
    };

    static Game m_instance = null;
    
    //private memeber
    private boolean m_debugVisible = false;

    // /Public method
    public void Init()
    {      
        //add hook
        Hook hook = new Hook();
//        hook.SetRotateOrigin(100.f, 200.f);
//        Hook hook2 = new Hook();
//        hook2.SetRotateOrigin(150.f, 200.f);
//        hook2.SetRotateSpeed(200.f);
        Stone stone = new Stone(400, 250);
//        hook.GetPhysElem().AddColliedElement(stone.GetPhysElem());
    }

    public void Update()
    {
        GameObjectManager.GetInstance().Update();
        PhysicsManager.GetInstance().Update();
        GraphicsManager.GetInstance().Update();
        Utility.GetInstance().Update();
    }

    public void CallBack()
    {
    }

    public void Render()
    {
    }

    public void Uninit()
    {
    }

    public void SetDebugVisible(boolean m_debugVisible)
    {
        this.m_debugVisible = m_debugVisible;
    }

    public boolean GetDebugVisible()
    {
        return m_debugVisible;
    }

}
